#include <REGX52.H>
#include <INTRINS.h>
#include "Delay.h"
#include "Key.h"
#include "Nixie.h"
#include "Timer0.h"
sbit DA=P2^1;
unsigned char Counter,Compare;//计数值 比较值
unsigned char i;
void main()
{
	  Timer0_Init();
	  Compare=2;
		while(1)
		{
			for(i=0;i<100;i++){
					Compare=i;
					Delay(10);
			}
			for(i=0;i>0;i--){
					Compare=i;
					Delay(10);
			}
		}

}
void Timer0_Routine() interrupt 1
		{
			TL0 = 0x9C;		  
			TH0 = 0xFF;
			Counter++;
			Counter%=100;//超过100清零
			if(Counter<Compare){
				DA=1;
			}else{
				DA=0;
			}
		}